app.controller('baseController',function ($scope) {

    $scope.reloadList=function () {
        $scope.search($scope.paginationConf.currentPage,$scope.paginationConf.itemsPerPage);
    }

        //定义分页配置
    $scope.paginationConf={
        currentPage: 1,   //当前页码
        totalItems : 10, //总记录数
        itemsPerPage : 10,//每页显示记录数
        perPageOptions:[10,15,20,30,40,50],//选择每页显示记录数下拉菜单选项
        onChange:function () {
            //从后台刷新读取分页数据
            $scope.reloadList();
        }
    }

    //选中id的集合
    $scope.selectIds=[];
    //更新复选
    $scope.updateSelection=function ($event,id) {
        if ($event.target.checked){
            $scope.selectIds.push(id);
        }else {
            var  idx=$scope.selectIds.indexOf(id);
            $scope.selectIds.splice(idx,1);
        }
    }
})